<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <!-- 兼容性 -->
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8" />
    <title>计划编制-关键节点计划列表</title>
    <script src="/scripts/boot.js"></script>
    <style>
        html,body{
            margin:0;padding: 0;border:0;width:100%;height:100%;overflow:hidden;
        }
        body{
            background: #ffffff!important;
            padding:20px;
        }
    </style>
</head>
<body>
<div id="viewForm">
    <div class="title-list mb-20"><span class="title-listbg"></span><span>项目关键节点计划编制</span></div>
    <div>
        <table class="table-bg" border="0" cellpadding="1" cellspacing="1" style="width:100%;table-layout:fixed;">
            <colgroup>
                <col width="135px"></col>
                <col width="50%"></col>
                <col width="135px"></col>
                <col width="50%"></col>
            </colgroup>
            <tr>
                <td class="text-titlebg">
                    <span>计划名称</span>
                </td>
                <td>
                    <input type="text" id="name" name="name" class="mini-textbox w220" readonly/>
                </td>
                <td class="text-titlebg">
                    <span>审核状态</span>
                </td>
                <td>
                    <input type="text" id="auditState" name="auditState" class="mini-textbox w220" readonly/>
                </td>
            </tr>
        </table>
    </div>
    <div class="mini-fit" style="height:400px;">
        <div id="datagrid1" class="mini-datagrid" style="width:100%;height:100%;" url="/keyPlanNode/listByPage" sizeList="[5,10,20,50]" pageSize="20"  idField="id" multiSelect="true">
            <div property="columns">
                <div field="NO" headerAlign="center" align="center" width="40">编号</div>
                <div field="business" width="100" headerAlign="center" align="center" allowSort="true">业务板块</div>
                <div field="nodeName" width="120" headerAlign="center" allowSort="true">节点名称</div>
                <div field="nodeProperty" width="100" headerAlign="center" align="center" allowSort="true">节点性质</div>
                <div field="completeStandard" width="120" headerAlign="center" allowSort="true">完成标准</div>
                <div field="deadline" width="100" headerAlign="center" align="center" allowSort="true">标准工期(天)</div>
                <div field="deadlineDesc" width="120" headerAlign="center" allowSort="true">工期说明</div>
                <div field="beginDate" width="120" headerAlign="center" align="center" allowSort="true">计划开始时间</div>
                <div field="endDate" width="120" headerAlign="center" align="center" allowSort="true">计划结束时间</div>
                <div field="companyName" width="120" headerAlign="center" allowSort="true">责任单位</div>
                <div field="officeName" width="120" headerAlign="center" align="center" allowSort="true">责任部门</div>
                <div field="postName" width="120" headerAlign="center" align="center" allowSort="true">责任岗位</div>
                <div field="remark" width="120" headerAlign="center" allowSort="true">备注</div>
            </div>
        </div>
    </div>
    <div class="chose-toolbar">
        <a class="chose-button" onclick="CloseWindow('close')">关闭</a>
    </div>
</div>
<script type="text/javascript">
    var post_flag,form,state,datas;
    var view = {
        init: function () {
            post_flag = false; //设置一个对象来控制是否进入AJAX过程
            mini.parse();
            form = new mini.Form("#viewForm");
        },
        //保存
        save: function () {
            form.validate();
            if (form.isValid() == false) return;
            if (post_flag) return;
            common.loading("保存中");
            var data = form.getData(true);//获取表单多个控件的数据
            post_flag = true;
            $.ajax({
                url: "/keyPlanNode/edit?id=" + data.id,
                type: "post",
                data: data,
                success: function (msg) {
                    post_flag = false;
                    common.unmask();
                    CloseWindow("ok");
                },
                error: function (errorMsg) {
                    post_flag = false;
                    common.unmask();
                }
            });
        },
        //    数据展示
        SetData: function (data) {
            data = mini.clone(data);
            mini.get("datagrid1").load({'plan.id': data.id});
            mini.get("name").setValue(data.name);
            var stateMsg = "";
            if(data.state == 0){
            	stateMsg = "未提交";
            }else if( data.state ==1){
            	stateMsg = "审批中";
            }else if(data.state == 2){
            	stateMsg = "通过"
            }else if(data.state == 3){
            	stateMsg = "未通过"
            }
            mini.get("auditState").setValue(stateMsg);        
            }
    };
    view.init();
</script>
</body>
</html>